///@file Box.cpp
///@brief Implementation of the class representing a box
///@author Arnaud Duval
///@version 0.0
///@date 2010/03/16

#include "../include/Box.h"
#include <cmath>
#include <cassert>

///@brief Default constructor
Box::Box()
{

}

///@brief Constructor with arguments
///@param Dp1 First point defining the diagonal
///@param Dp2 Second point defining the diagonal
Box::Box(Point Dp1, Point Dp2)
{
	assert(Dp1.Dim() == Dp2.Dim());
	assert(Dp1.Dim() == 3);
	p1 = Dp1;
	p2 = Dp2;
}

///@brief Destructor
Box::~Box()
{

}

///@brief Compute volume value
double Box::value()
{
	return fabs((p1.Coord(1) - p2.Coord(1))*(p1.Coord(2) - p2.Coord(2))*(p1.Coord(3) - p2.Coord(3)));
}